package com.abhinav;

public class LinkedList {
	private Node head;
	private Node tail;
	
	public LinkedList(){
		this.head = new Node("head");
		tail = head;
	}
	
	public Node head(){
		return head;
	}
	
	public void add(Node node){
		tail.next = node;
		tail = node;
	}
	
	public void addToBegining(Node node){
		if(head == null){
			// The LinkList is empty, adding the first node
			
		}
	}
	
	public static class Node{
		private Node next;
		private Object data;
		
		public Node(Object data){
			this.data = data;
		}
		
		public Object data(){
            return data;
         }
 
        public void setData(Object data) {
             this.data = data;
         }
 
        public Node next() {
             return next;
         }
 
        public void setNext(Node next) {
             this.next = next;
         }
       
        public String toString(){
            return (String) this.data;
         }
	}

}
